<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>div文本垂直居中1</title>
    <style>
      * {
        padding: 0px;
        margin: 0px;
      }

      .box {
        padding: 70px 0;
        border: 3px solid green;
      }
    </style>
  </head>
  <body>
    <div class="title">
      <div>设置元素上下内填充为相同值即可实现文本垂直居中对齐</div>
    </div>
    <div class="container">
      <div class="box">文本</div>
    </div>
  </body>
</html>
